<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Engine::Game</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Engine::Game</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/engine/game_rb.html">
                engine/game.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Gosu::Window
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000050">button_down</a>&nbsp;&nbsp;
      <a href="#M000049">button_up</a>&nbsp;&nbsp;
      <a href="#M000048">draw</a>&nbsp;&nbsp;
      <a href="#M000046">end_fade!</a>&nbsp;&nbsp;
      <a href="#M000043">fade_off</a>&nbsp;&nbsp;
      <a href="#M000044">fade_on</a>&nbsp;&nbsp;
      <a href="#M000045">fading?</a>&nbsp;&nbsp;
      <a href="#M000037">fonts</a>&nbsp;&nbsp;
      <a href="#M000040">game_state</a>&nbsp;&nbsp;
      <a href="#M000041">game_state=</a>&nbsp;&nbsp;
      <a href="#M000036">images</a>&nbsp;&nbsp;
      <a href="#M000052">load_fonts</a>&nbsp;&nbsp;
      <a href="#M000051">load_images</a>&nbsp;&nbsp;
      <a href="#M000035">new</a>&nbsp;&nbsp;
      <a href="#M000042">quit</a>&nbsp;&nbsp;
      <a href="#M000039">sprite_collection</a>&nbsp;&nbsp;
      <a href="#M000038">sprites</a>&nbsp;&nbsp;
      <a href="#M000047">update</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->
    <div id="includes">
      <h3 class="section-bar">Included Modules</h3>

      <div id="includes-list">
        <span class="include-name">Singleton</span>
      </div>
    </div>

    <div id="section">


    <div id="constants-list">
      <h3 class="section-bar">Constants</h3>

      <div class="name-list">
        <table summary="Constants">
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ScreenWidth</td>
          <td>=</td>
          <td class="context-item-value">550</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">ScreenHeight</td>
          <td>=</td>
          <td class="context-item-value">600</td>
        </tr>
        <tr class="top-aligned-row context-row">
          <td class="context-item-name">FadingTime</td>
          <td>=</td>
          <td class="context-item-value">1000</td>
        </tr>
        </table>
      </div>
    </div>



      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000046" class="method-detail">
        <a name="M000046"></a>

        <div class="method-heading">
          <a href="Game.src/M000046.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000046.html');return false;">
          <span class="method-name">end_fade!</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
 Ends fade transitions
</p>
        </div>
      </div>

      <div id="method-M000043" class="method-detail">
        <a name="M000043"></a>

        <div class="method-heading">
          <a href="Game.src/M000043.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000043.html');return false;">
          <span class="method-name">fade_off</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Starts a fade off transition
</p>
        </div>
      </div>

      <div id="method-M000044" class="method-detail">
        <a name="M000044"></a>

        <div class="method-heading">
          <a href="Game.src/M000044.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000044.html');return false;">
          <span class="method-name">fade_on</span><span class="method-args">(time)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Starts a fade on transition
</p>
        </div>
      </div>

      <div id="method-M000045" class="method-detail">
        <a name="M000045"></a>

        <div class="method-heading">
          <a href="Game.src/M000045.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000045.html');return false;">
          <span class="method-name">fading?</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns whether there is a fade running or not
</p>
        </div>
      </div>

      <div id="method-M000037" class="method-detail">
        <a name="M000037"></a>

        <div class="method-heading">
          <a href="Game.src/M000037.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000037.html');return false;">
          <span class="method-name">fonts</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a hash map with the <a href="Game.html#M000037">fonts</a>
collection
</p>
        </div>
      </div>

      <div id="method-M000040" class="method-detail">
        <a name="M000040"></a>

        <div class="method-heading">
          <a href="Game.src/M000040.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000040.html');return false;">
          <span class="method-name">game_state</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the current game state
</p>
        </div>
      </div>

      <div id="method-M000041" class="method-detail">
        <a name="M000041"></a>

        <div class="method-heading">
          <a href="Game.src/M000041.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000041.html');return false;">
          <span class="method-name">game_state=</span><span class="method-args">(st)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Changes to another game state
</p>
        </div>
      </div>

      <div id="method-M000036" class="method-detail">
        <a name="M000036"></a>

        <div class="method-heading">
          <a href="Game.src/M000036.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000036.html');return false;">
          <span class="method-name">images</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a hash map with the <a href="Game.html#M000036">images</a>
collection
</p>
        </div>
      </div>

      <div id="method-M000035" class="method-detail">
        <a name="M000035"></a>

        <div class="method-heading">
          <a href="Game.src/M000035.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000035.html');return false;">
          <span class="method-name">new</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Constructor. Setups the video mode and creates a window (60 fps)
</p>
        </div>
      </div>

      <div id="method-M000042" class="method-detail">
        <a name="M000042"></a>

        <div class="method-heading">
          <a href="Game.src/M000042.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000042.html');return false;">
          <span class="method-name">quit</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Quits game
</p>
        </div>
      </div>

      <div id="method-M000039" class="method-detail">
        <a name="M000039"></a>

        <div class="method-heading">
          <a href="Game.src/M000039.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000039.html');return false;">
          <span class="method-name">sprite_collection</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns the sprite collection
</p>
        </div>
      </div>

      <div id="method-M000038" class="method-detail">
        <a name="M000038"></a>

        <div class="method-heading">
          <a href="Game.src/M000038.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000038.html');return false;">
          <span class="method-name">sprites</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Returns a hash map with the sprite lists
</p>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000050" class="method-detail">
        <a name="M000050"></a>

        <div class="method-heading">
          <a href="Game.src/M000050.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000050.html');return false;">
          <span class="method-name">button_down</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Gets called automatically by Gosu when a button is pressed
</p>
        </div>
      </div>

      <div id="method-M000049" class="method-detail">
        <a name="M000049"></a>

        <div class="method-heading">
          <a href="Game.src/M000049.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000049.html');return false;">
          <span class="method-name">button_up</span><span class="method-args">(id)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Gets called automatically by Gosu when a button is released
</p>
        </div>
      </div>

      <div id="method-M000048" class="method-detail">
        <a name="M000048"></a>

        <div class="method-heading">
          <a href="Game.src/M000048.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000048.html');return false;">
          <span class="method-name">draw</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Draws the game entities on the screen. Gets called automatically by Gosu
each frame
</p>
        </div>
      </div>

      <div id="method-M000052" class="method-detail">
        <a name="M000052"></a>

        <div class="method-heading">
          <a href="Game.src/M000052.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000052.html');return false;">
          <span class="method-name">load_fonts</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Loads all <a href="Game.html#M000037">fonts</a> needed and stores them into
the <a href="Game.html#M000037">fonts</a> hash map
</p>
        </div>
      </div>

      <div id="method-M000051" class="method-detail">
        <a name="M000051"></a>

        <div class="method-heading">
          <a href="Game.src/M000051.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000051.html');return false;">
          <span class="method-name">load_images</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Loads all the <a href="Game.html#M000036">images</a> and stores them into
the <a href="Game.html#M000036">images</a> hash map
</p>
        </div>
      </div>

      <div id="method-M000047" class="method-detail">
        <a name="M000047"></a>

        <div class="method-heading">
          <a href="Game.src/M000047.html" target="Code" class="method-signature"
            onclick="popupCode('Game.src/M000047.html');return false;">
          <span class="method-name">update</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Updates the game logic. Gets called automatically by Gosu each frame
</p>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>